package com.system.common;

/**
 * 通用接口返回状态码
 *
 * @Author 佛冷
 * @Date 2020/6/8 11:06
 */
public enum ResponseCode {

    /**
     * 成功
     */
    RESPONSE_SUCCESS(200, "success"),

    /**
     * 服务端错误
     */
    RESPONSE_ERROR(500, "服务端错误"),

    /**
     * 未认证
     */
    UNAUTHORIZED(401, "认证失败"),

    /**
     * 登录错误码
     */
    LOGIN_ERROR(101, "用户名或密码错误"),

    /**
     * 操作失败
     */
    EDIT_ERROR(102, "操作失败"),

    /**
     * 参数缺失
     */
    PARAMS_ERROE(103, "参数缺失"),

    /**
     * 编辑失败
     */
    DELETE_ERROR(104, "删除失败"),

    /**
     * 必传参数缺失
     */
    PARAM_LACK_ERROR(105, "缺失必传参数值"),

    /**
     * 数据源切换异常
     */
    DATA_SOURCE_ERROR(106, "数据源切换异常");

    private int code;

    private String msg;

    ResponseCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
